package cumt.kydd.authoringplatform.controller;

import cumt.kydd.authoringplatform.bean.History;
import cumt.kydd.authoringplatform.service.SaveHistoryService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("platform")
public class SaveHistoryController {
    public static String UserOriginText;
    public static String UserSummary;
    public static String UserTitle;
    @Resource
    private SaveHistoryService historyService;


    @GetMapping("save")
    public Map<String, Object> createHistory(String originText,String summary,String title,History history)
    {
        UserOriginText = originText;
        UserSummary = summary;
        UserTitle = title;
        System.out.println("-----------------");
        System.out.println("传来的原始文本"+UserOriginText);
        System.out.println("传来的生成的摘要"+UserSummary);
        System.out.println("传来的生成的标题"+UserTitle);
        return historyService.createHistory(history);
    }
//    @RequestMapping(value = "save",method = GET)
//    @ResponseBody
//    public History historyQuery(History history){
//        System.out.println("---这是query分界线----");
//        System.out.println(historyService.HistoryQuery(history));
//        return historyService.HistoryQuery(history);
//    }
}
